

// 用户ID
let id = getUrlParam("id");
$(function () {
    GetUserRole();
});
//获取用户权限
function GetUserRole() {
    // let thisdata = [];
    // thisdata.push(InitRole(id));
    let USERdata = InitRole(id);
    if (USERdata != null) {
       
        InitData();
    }
    else OpenErrmsg("../../web/errhtml/404.html");
}


function InitData() {
    //后台返回数据--能源类型数据  根据Liquid_Type区分  最多五条数据
    var data1 = [
        { "ID": "Plan01", "Data_Type_Code": "Water", "Data_Type_Name": "淡水", "Data_Type_Unit": "m³","Data_Qty":20 },
        { "ID": "Plan01", "Data_Type_Code": "MEG", "Data_Type_Name": "MEG舱", "Data_Type_Unit": "m³","Data_Qty":20 },
        { "ID": "Plan01", "Data_Type_Code": "SLOP", "Data_Type_Name": "SLOP舱", "Data_Type_Unit": "m³","Data_Qty":20 },
        { "ID": "Plan01", "Data_Type_Code": "NXY", "Data_Type_Name": "凝析油舱", "Data_Type_Unit": "m³","Data_Qty":20 },
        { "ID": "Plan01", "Data_Type_Code": "CY", "Data_Type_Name": "柴油", "Data_Type_Unit": "m³","Data_Qty":20 },

    ];
    //后台返回数据--药剂类型数据  根据Liquid_Type区分  最多五条数据
    var data2 = [
        { "ID": "Plan01", "Data_Type_Code": "TEG", "Data_Type_Name": "TEG", "Data_Type_Unit": "m³","Data_Qty":20 },
        { "ID": "Plan01", "Data_Type_Code": "SXJ", "Data_Type_Name": "酸洗剂", "Data_Type_Unit": "m³","Data_Qty":20 },
        { "ID": "Plan01", "Data_Type_Code": "HYP", "Data_Type_Name": "HYP-105", "Data_Type_Unit": "m³","Data_Qty":20 },
        { "ID": "Plan01", "Data_Type_Code": "DEF", "Data_Type_Name": "Defoamer", "Data_Type_Unit": "m³","Data_Qty":20 },
        { "ID": "Plan01", "Data_Type_Code": "COR", "Data_Type_Name": "CORR21133A", "Data_Type_Unit": "m³","Data_Qty":20 },
    ];
    $('#dg_dataList1').datagrid({
        data: data1
    });
    $('#dg_dataList2').datagrid({
        data: data2
    });
}
function formaterQty(value, row) {
    let str = ' <label style="color:#589BD8">' + value +'   '+ row.Data_Type_Unit+'</label><br />';
    return str;
}

